home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
BASE_HIB.TAS
< prev
next >
Wrap
Text File
|
1992-03-27
|
8KB
|
191 lines
{
This script is geared toward investors who like
to buy stocks at or near new highs, as they emerge
from basing patterns. It finds and graphs all stocks
which are making new highs, and all stocks which are
within 5% of their high AND have been in a narrow
trading range for a period of time.
The graph of the stock appears on the screen and any
base found is defined with red lines. Stocks making
new highs will not always show base lines. The "base"
shown in the legend on top of the price graph tells how
many days the stock has traded within 15%.
The volume graph plots the 50 day moving average and
tells how today's volume compares with the 50MA. The
5MA and 10MA comparisons are also shown. The 5MA and
10MA calculations do not include today, rather they
end yesterday. They attempt to show how volume behaved
immediately prior to today's action.
Most data is displayed on the screen during processing,
and it is saved in the output file "BASE-NH.LST".
Written 3/18/92 by Tom Rategan. Prodigy PMGV10A
Modifications made to include a for loop to find the
range and a second page of graphs.
Modified 3/18/92 Jerry Green
Summary report added.
Modified 3/27/92 Jerry Green}
#max_quotes 255
#output_file 'BASE-NH.LST'
if first_ticker then begin
writeln(
' ********* New highs and possible near base breakouts. *********
');
writeln(
' All Time |--Base--|');
writeln(
' Name Close Change %OH High %Rng Days Vol %V'
);
writeln(
' ---- ----- ------ --- ---- ---- ---- --- --'
);
end;
{**********************************************************}
{ Count Tickers }
{**********************************************************}
tick_count = tick_count + 1;
{**********************************************************}
{ Declare Arrays }
{**********************************************************}
lorg : array;
hirg : array;
vo50 : array;
{**********************************************************}
{ Do Some Filtering }
{**********************************************************}
if quote_count < 65 then gosub Summary;
qc = (quote_count-2);
hiqc = hhv(c,qc);
if c < (hiqc * .95) then gosub Summary;
hipcnt = hiqc * .85;
if c >= hiqc then
newhigh_switch = 1;
else
newhigh_switch = 0;
{**********************************************************}
{ Filter and Count }
{**********************************************************}
hi30 = hhv(c,30);
lo30 = llv(c,30);
r30 = (1-(lo30/hi30))*100;
if r30 > 15 then
gosub Summary
else
count_15 = count_15 + 1;
if r30 < 10 then
count_10 = count_10 + 1;
if r30 < 5 then
count_5 = count_5 + 1;
if newhigh_switch = 1 then
count_hi = count_hi + 1;
{**********************************************************}
{ Check Conditions }
{**********************************************************}
t = 0;
done = 0;
for i = 0; done = 0; i = i - 1;
begin
if i <= -qc then
done = 1;
if c[i] >= lo30 and c[i] <= hi30 then
t = t + 1;
else
done = 1;
end;
{**********************************************************}
{ Calculate Equations }
{**********************************************************}
hirg = hhv(c,t);
lorg = llv(c,t);
rng = (1-(lorg/hirg))*100;
vo50 = mov(v,50,'s');
vvo50 = (v/vo50)*100;
v5 = mov(v,5,'s');
v5vo50 = (v5/vo50)*100;
v10 = mov(v,10,'s');
v10vo50 = (v10/vo50)*100;
oh = 100-((c/hiqc)*100);
chg = c-c[-1];
{**********************************************************}
{ Graph Results }
{**********************************************************}
opengraph(2);
sizegraph(4,2);
graph(1,' '+format(c[0],'$%5.2f')+' is '
+format(oh,'%2.1f%')+' off '
+format(hiqc,'$%5.2f')+' high. Change= '
+format(chg,'$%2.2f')
+' Base less than '+format(rng,'%2.1f%')
+' for '+format(t,'%2.f')+' days.');
if newhigh_switch = 1 then
goto graphvol;
drawline(12,0,lorg[-1],0,lorg[-1],-t,-1);
drawline(12,0,hirg[-1],0,hirg[-1],-t,-1);
:graphvol
graph(v,'Today='+format(v[0],'%5.f')
+' 50MA='+format(vo50[0],'%5.f')
+' %Today='+format(vvo50,'%4.f%')
+' 5MA='+format(v5vo50,'%4.f%')
+' of 50MA. 10MA='+format(v10vo50,'%4.f%')
+' of',vo50,'50MA');
closegraph();
{**********************************************************}
{ Write Results }
{**********************************************************}
if newhigh_switch = 1 then
goto write_nobase;
writeln(fullname,' ',c[0],' ',chg,int(oh),'%',
hiqc,int(rng),'%',int(t),' ',int(v[0]),
int(vvo50),'%');
gosub standard_2;
{**********************************************************}
{ Don't confuse brains for a bull market }
{**********************************************************}
:write_nobase
writeln(fullname,' ',c[0],' ',chg,int(oh),'%',hiqc,
' No Base ',int(v[0]),int(vvo50),'%');
gosub standard_2;
{**********************************************************}
{ Standard 2nd Page Graph }
{**********************************************************}
:standard_2
opengraph(4,-60,0);
graph(stoch(5,3),'5-3 Stochastic with lines on 80 and 20');
drawline(4,0,80,0,80);
drawline(4,0,20,0,20);
graph(MACD(),'MACD and Trigger',MACDTRI());
graph(CCI(10),'10 DAY CCI');
graph(rsi(14),'14 DAY Relative Strength with lines on 70 and 30');
drawline(4,0,70,0,70);
drawline(4,0,30,0,30);
closegraph();
:Summary
{**********************************************************}
{ Calculate Count }
{**********************************************************}
if last_ticker then
begin
percent_new_highs = (count_hi/tick_count)*100;
percent_15 = (count_15/tick_count)*100;
percent_10 = (count_10/tick_count)*100;
percent_5 = (count_5/tick_count)*100;
off_high = tick_count - count_hi - count_15 -
count_10 - count_5;
percent_off_high = (off_high/tick_count)*100;
{**********************************************************}
{ Write Summary }
{**********************************************************}
Writeln();
Writeln('************** SUMMARY ****************');
Writeln(int(tick_count),' Total Tickers Processed');
Writeln(' ',int(count_hi),' ',' New Highs ',
format(percent_new_highs,'%4.1f%'),' of total');
Writeln(' ',int(count_5),' ',' <= 5% Off High',
format(percent_5,'%4.1f%'),' of total');
Writeln(' ',int(count_10),' ',' <= 10% Off High',
format(percent_10,'%4.1f%'),' of total');
Writeln(' ',int(count_15),' ',' <= 15% Off High',
format(percent_15,'%4.1f%'),' of total');
Writeln(' ',int(off_high),' ',' > 15% ',
format(percent_off_high,'%4.1f%'),' of total');
end;